package RMI;

import java.rmi.*;
import java.rmi.registry.*;
/**
 * create bind between remote and client service
 * @author ran & barak
 *
 */
public class ContactService {
	Registry registry;
    String address;
    String port;
    /**
     * constructor of class
     */
	public ContactService() {
		address="localhost";
		port="1234";
	}
	/**
	 * 
	 * @return the remote object
	 * @throws NumberFormatException
	 * @throws RemoteException
	 * @throws NotBoundException
	 */
	public RemoteInt getRemote() throws NumberFormatException, RemoteException, NotBoundException{
		registry=LocateRegistry.getRegistry(address,(new Integer(port)).intValue());
		return (RemoteInt)(registry.lookup("remoteControlServer"));
	}
}
